package com.qidian.mespro.controller;

import com.qidian.mespro.mapper.DictDataMapper;
import com.qidian.mespro.service.DictDataService;
import com.qidianit.mes.pojo.Result;
import com.qidianit.mes.pojo.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ author: 周晓轩
 * @ company 起点编程
 * @ time: 2025/9/22 - 23:46
 * @ Description:
 */
@RestController
@RequestMapping("/dict")
public class DictController {

 @Autowired
 private DictDataService dictDataService;

 /**
  * 查询工单类型字典数据
  */
 @GetMapping("/productionOrderType")
 public Result<List<SysDictData>> getProductionOrderTypeDict() {
  List<SysDictData> dictDataList = dictDataService.listByDictType("production_order_type");
  return Result.success(dictDataList);
 }

 /**
  * 查询工单状态字典数据
  */
 @GetMapping("/productionOrderStatus")
 public Result<List<SysDictData>> getProductionOrderStatusDict() {
  List<SysDictData> dictDataList = dictDataService.listByDictType("production_order_status");
  return Result.success(dictDataList);
 }
}
